from multiprocessing import Value,Manager
import multiprocessing as mu
import random

def man(money):
    for i in range(30):
        money.value+=random.randint(1,300)


def girl(money):
    for i in range(30):
        money.value-=random.randint(100,500)


if __name__=="__main__":
    money = Value("i", 26000)
    man_save=mu.Process(target=man,args=(money,))
    girl_cost=mu.Process(target=girl,args=(money,))
    man_save.start()
    girl_cost.start()
    man_save.join()
    girl_cost.join()
    print("剩下的money:",money.value)